.PHONY: clean
CC = gcc
RM = rm -f
EXE = simple
#SRCS = main.c foo.c
SRCS = $(wildcard *.c)
# 把.c替换为.o
# OBJS = main.o foo.o
OBJS = $(patsubst %.c,%.o,$(SRCS))

$(EXE): $(OBJS)
	$(CC) -o $@ $^
%.o: %.c
# 	$(CC) -o $@ -c $<
	$(CC) -o $@ -c $^
clean:
	$(RM) $(EXE) $(OBJS)